using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CollegeShop.Infrastructure.Entities.Repository;

namespace CollegeShop.Infrastructure.Entities.Entity
{
    public class Purchasedetail : IAccessible<T_Purchasedetail, Purchasedetail>, ILogicEntity<T_Purchasedetail, Purchasedetail>
    {
        public int ID { get; set; }

        public int PurchaseID { get; set; }

        public int GoodsID { get; set; }

        public int PurchaseAmount { get; set; }

        public string Unit { get; set; }

        public int PackStandard { get; set; }

        public decimal PurchasePrice { get; set; }

        public decimal PurchaseMoney { get; set; }

        public int PutInAmount { get; set; }

        protected override void Covariant(T_Purchasedetail model)
        {
            if (model != null)
            {
                    this.ID = model.ID;
                    this.PurchaseID = model.PurchaseID;
                    this.GoodsID = model.GoodsID;
                    this.PurchaseAmount = model.PurchaseAmount;
                    this.Unit = model.Unit;
                    this.PackStandard = model.PackStandard;
                    this.PurchasePrice = model.PurchasePrice;
                    this.PurchaseMoney = model.PurchaseMoney;
                    this.PutInAmount = model.PutInAmount;
            }
}
        protected override T_Purchasedetail Inverter(Purchasedetail model)
        {
            if (model != null)
            {
                return new T_Purchasedetail()
                {
                    ID = model.ID,
                    PurchaseID = model.PurchaseID,
                    GoodsID = model.GoodsID,
                    PurchaseAmount = model.PurchaseAmount,
                    Unit = model.Unit,
                    PackStandard = model.PackStandard,
                    PurchasePrice = model.PurchasePrice,
                    PurchaseMoney = model.PurchaseMoney,
                    PutInAmount = model.PutInAmount,
                };
            }
            return null;
        }
        public Purchasedetail Set(T_Purchasedetail dbModel)
        {
            Covariant(dbModel);
            return this;
        }
    }
}
